package com.chance.cc.crawler.prod.command.trigger.domain.news.tenxun;

import com.chance.cc.crawler.core.CrawlerJob;
import com.chance.cc.crawler.meta.core.bean.CrawlerMetaConstant;
import com.chance.cc.crawler.prod.command.job.domain.news.tenxun.TXCommonScript;
import com.chance.cc.crawler.prod.command.job.domain.news.tenxun.qqcarnews.QqCarNewsCrawlerScheduleJob;
import com.chance.cc.crawler.prod.command.job.domain.news.tenxun.realtime.TXRealtimeCrawlerSchedulerJob;
import com.chance.cc.crawler.prod.command.job.domain.news.tenxun.realtime.TXVideoRealtimeCrawlerSchedulerJob;
import com.chance.cc.crawler.prod.command.job.domain.news.tenxun.realtime.TencentCrarCrawlerScheduleJob;
import com.chance.cc.crawler.prod.command.job.domain.news.tenxun.trace.TXCommentTraceCrawlerSchedulerJob;
import com.chance.cc.crawler.prod.command.job.domain.news.tenxun.trace.TXTraceCrawlerSchedulerJob;
import com.chance.cc.crawler.prod.command.job.domain.news.tenxun.trace.TXVideoCommentTraceCrawlerSchedulerJob;
import com.chance.cc.crawler.prod.command.job.domain.news.tenxun.trace.TXVideoTraceCrawlerSchedulerJob;
import com.chance.cc.crawler.prod.command.trigger.CommonCrawlerSchedulerTrigger;

/**
 * @author lt
 * @version 1.0
 * @date 2021-04-09 17:56:34
 * @email okprog@sina.com
 */
public class TenXunCommonCrawlerSchedulerTrigger extends CommonCrawlerSchedulerTrigger {

    public static void main(String[] args) {
//        publishTXRealtimeScheduleTriggerInfo();
//
//        publishTXTraceScheduleTriggerInfo();
//
       // publishTXCommentTraceScheduleTriggerInfo();
//
        //video
       // publishTXVideoRealtimeScheduleTriggerInfo();

        //publishTXVideoTraceScheduleTriggerInfo();

        //publishTXVideoCommentTraceScheduleTriggerInfo();

//        publishTXVideoSimpleScheduleTriggerInfo();

        //腾讯车型文章
        publishTXCarSimpleScheduleTriggerInfo();
        //publishCarNewsScheduleTriggerInfo();
    }

    public static void publishTXRealtimeScheduleTriggerInfo(){
        CrawlerJob crawlerJob = TXRealtimeCrawlerSchedulerJob.crawlerScheduler();
        metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                TXCommonScript.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 0/10 * * * ?",
                "腾讯新闻实时采集任务，每十分钟采集一次");
    }

    public static void publishTXTraceScheduleTriggerInfo(){
        CrawlerJob crawlerJob = TXTraceCrawlerSchedulerJob.crawlerScheduler();
        metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                TXCommonScript.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 30 0 * * ?",
                "腾讯新闻追溯7日评论采集任务，每天采集一次");
    }

    public static void publishTXCommentTraceScheduleTriggerInfo(){
        CrawlerJob crawlerJob = TXCommentTraceCrawlerSchedulerJob.crawlerScheduler();
        metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                TXCommonScript.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 0 0/1 * * ?",
                "腾讯新闻追溯当日评论采集任务，每2小时采集一次");
    }

    public static void publishTXVideoRealtimeScheduleTriggerInfo(){
        CrawlerJob crawlerJob = TXVideoRealtimeCrawlerSchedulerJob.crawlerScheduler();
        metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                TXCommonScript.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 0/30 * * * ?",
                "腾讯视频实时采集任务，每小时采集一次");
    }

    public static void publishTXVideoTraceScheduleTriggerInfo(){
        CrawlerJob crawlerJob = TXVideoTraceCrawlerSchedulerJob.crawlerScheduler();
        metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                TXCommonScript.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 30 0 * * ?",
                "腾讯视频追溯7日评论采集任务，每天采集一次");
    }

    public static void publishTXVideoCommentTraceScheduleTriggerInfo(){
        CrawlerJob crawlerJob = TXVideoCommentTraceCrawlerSchedulerJob.crawlerScheduler();
        metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                TXCommonScript.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 0 0/2 * * ?",
                "腾讯视频追溯当日评论采集任务，每2小时采集一次");
    }



    public static void publishTXVideoSimpleScheduleTriggerInfo(){
        CrawlerJob crawlerJob = TXVideoRealtimeCrawlerSchedulerJob.crawlerScheduler();
        metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                TXCommonScript.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Simple,
                "",
                "腾讯视频实时采集任务单次测试");
    }
    public static void publishTXCarSimpleScheduleTriggerInfo(){
        CrawlerJob crawlerJob = TencentCrarCrawlerScheduleJob.ArticleScheduler();
        metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                TencentCrarCrawlerScheduleJob.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 0 0 1 * ?",
                "腾讯汽车车系信息每月一号采集");
    }
    public static void publishCarNewsScheduleTriggerInfo(){
        CrawlerJob crawlerJob = QqCarNewsCrawlerScheduleJob.articleSchedule();
        metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                QqCarNewsCrawlerScheduleJob.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 0 0 * * ?",
                "腾讯汽车文章采集"
        );
    }
}
